/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CheckInForm.java
 *
 * Created on 05 Nov 11, 12:54:56
 */
package Com.Checkin_Checkout_Kamar_Case;

import Com.Entity.Karyawan;
import Com.Entity.TransaksiKamar;
import Com.HallRenting_Case.TransaksiGedungController;
import SistemPenyewaanKamar.MainController;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

/**
 *
 * @author mita
 */
public class CheckInForm extends javax.swing.JDialog {

    /** Creates new form CheckInForm */
    public CheckInForm(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                TransaksiKamarController.exit(CheckInForm.this, noCheckinTextField.getText());
            }
        });
        TransaksiGedungController.showDateAndClock(jamLabel1, tanggalLabel);
        noCheckinTextField.setEditable(false);
        buttonGroup1.add(priaRadioButton1);
        buttonGroup1.add(wanitaButtonGrup);
        Karyawan kay = Karyawan.getusrID();
        idKaryawan.setText(kay.getUsername());

        try {
            TransaksiKamar call;
            call = TransaksiKamar.getKoneksiKontrol();
            noCheckinTextField.setText(TransaksiKamarController.noTrans(call));
        } catch (SQLException ex) {
            Logger.getLogger(CheckInForm.class.getName()).log(Level.SEVERE, null, ex);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(CheckInForm.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(CheckInForm.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        checkinbutton = new javax.swing.JButton();
        cancelButon = new javax.swing.JButton();
        jLabel14 = new javax.swing.JLabel();
        tanggalLabel = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jamLabel1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        namaText = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        alamatText = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        noKTPtext = new javax.swing.JTextField();
        priaRadioButton1 = new javax.swing.JRadioButton();
        wanitaButtonGrup = new javax.swing.JRadioButton();
        jLabel7 = new javax.swing.JLabel();
        tipekamarComboBox = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        tempatlahirText = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        nomorHPTextField = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jumpenyewaText = new javax.swing.JTextField();
        noCheckinTextField = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        noKamarComboBox = new javax.swing.JComboBox();
        tanggalLahirChooser = new com.toedter.calendar.JDateChooser();
        jLabel17 = new javax.swing.JLabel();
        jenisKTPComboBox = new javax.swing.JComboBox();
        jLabel19 = new javax.swing.JLabel();
        idkaryawanLabel = new javax.swing.JLabel();
        idKaryawan = new javax.swing.JLabel();
        batalButt = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setLayout(null);

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24));
        jLabel1.setText("CHECK IN FORM");
        jPanel1.add(jLabel1);
        jLabel1.setBounds(260, 30, 320, 40);

        jLabel3.setFont(new java.awt.Font("Verdana", 0, 14));
        jLabel3.setText("Tanggal");
        jPanel1.add(jLabel3);
        jLabel3.setBounds(500, 60, 60, 18);

        checkinbutton.setText("CHECK IN");
        checkinbutton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkinbuttonActionPerformed(evt);
            }
        });
        jPanel1.add(checkinbutton);
        checkinbutton.setBounds(600, 490, 110, 23);

        cancelButon.setText("KEMBALI KE MENU MAIN FORM");
        cancelButon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButonActionPerformed(evt);
            }
        });
        jPanel1.add(cancelButon);
        cancelButon.setBounds(40, 490, 250, 23);

        jLabel14.setFont(new java.awt.Font("Verdana", 0, 14));
        jLabel14.setText("Jam");
        jPanel1.add(jLabel14);
        jLabel14.setBounds(500, 80, 60, 18);

        tanggalLabel.setFont(new java.awt.Font("Verdana", 1, 14)); // NOI18N
        jPanel1.add(tanggalLabel);
        tanggalLabel.setBounds(590, 60, 120, 20);
        jPanel1.add(jLabel16);
        jLabel16.setBounds(570, 60, 90, 0);

        jamLabel1.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        jPanel1.add(jamLabel1);
        jamLabel1.setBounds(590, 80, 130, 20);

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel2.setText("Nama Tamu  ");

        jLabel4.setText("Alamat Asal");

        jLabel5.setText("No.KTP/ Pasport ");

        jLabel6.setText("Jenis Kelamin  ");

        priaRadioButton1.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(priaRadioButton1);
        priaRadioButton1.setText("Pria");

        wanitaButtonGrup.setBackground(new java.awt.Color(255, 255, 255));
        buttonGroup1.add(wanitaButtonGrup);
        wanitaButtonGrup.setText("Wanita");

        jLabel7.setText("Tipe Kamar");

        tipekamarComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-Pilih Tipe Kamar-", "VVIP ROOM", "VIP ROOM", "COMMON ROOM" }));
        tipekamarComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tipekamarComboBoxActionPerformed(evt);
            }
        });

        jLabel8.setText("Tempat/ tanggal lahir");

        jLabel9.setText("Nomor Handphone");

        nomorHPTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                nomorHPTextFieldKeyReleased(evt);
            }
        });

        jLabel10.setText("Jumlah Penyewa Kamar");

        jumpenyewaText.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jumpenyewaTextKeyReleased(evt);
            }
        });

        jLabel12.setText("Nomor Check In");

        jLabel13.setText("Nomor Kamar");

        jLabel18.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel18.setText("/");

        noKamarComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-Nomor Kamar - Status Booking-" }));

        jLabel17.setText("Jenis ID");

        jenisKTPComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-Pilih Jenis ID-", "KTP", "Passport" }));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(40, 40, 40)
                                .addComponent(namaText, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(50, 50, 50)
                                .addComponent(alamatText, javax.swing.GroupLayout.PREFERRED_SIZE, 490, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(40, 40, 40)
                                .addComponent(noKTPtext, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jenisKTPComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(20, 20, 20)
                                .addComponent(tempatlahirText, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(10, 10, 10)
                                .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(10, 10, 10)
                                .addComponent(tanggalLahirChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(50, 50, 50)
                                .addComponent(priaRadioButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(10, 10, 10)
                                .addComponent(wanitaButtonGrup, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(50, 50, 50)
                                .addComponent(tipekamarComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(30, 30, 30)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGap(90, 90, 90)
                                        .addComponent(noKamarComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 230, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(20, 20, 20)
                                .addComponent(nomorHPTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(140, 140, 140)
                                .addComponent(jumpenyewaText, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(40, 40, 40)
                        .addComponent(noCheckinTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel12)
                    .addComponent(noCheckinTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(namaText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(alamatText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(noKTPtext, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jenisKTPComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(10, 10, 10)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8)
                    .addComponent(tempatlahirText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tanggalLahirChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(priaRadioButton1)
                    .addComponent(wanitaButtonGrup))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tipekamarComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(noKamarComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addGap(10, 10, 10)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel9)
                    .addComponent(nomorHPTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10)
                    .addComponent(jumpenyewaText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26))
        );

        jPanel1.add(jPanel2);
        jPanel2.setBounds(40, 140, 660, 310);

        jLabel19.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Com/Checkin_Checkout_Kamar_Case/cdc98_101525_junior-suite--the-sultan-hotel.jpg"))); // NOI18N
        jPanel1.add(jLabel19);
        jLabel19.setBounds(40, -20, 370, 220);

        idkaryawanLabel.setFont(new java.awt.Font("Arial", 0, 12));
        idkaryawanLabel.setText("ID Karyawan");
        jPanel1.add(idkaryawanLabel);
        idkaryawanLabel.setBounds(500, 110, 70, 20);
        jPanel1.add(idKaryawan);
        idKaryawan.setBounds(590, 110, 70, 20);

        batalButt.setText("BATAL");
        batalButt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                batalButtActionPerformed(evt);
            }
        });
        jPanel1.add(batalButt);
        batalButt.setBounds(493, 490, 90, 23);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 742, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 539, Short.MAX_VALUE)
        );

        pack();
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        java.awt.Dimension dialogSize = getSize();
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
    }// </editor-fold>//GEN-END:initComponents

    private void tipekamarComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tipekamarComboBoxActionPerformed
        try {
            TransaksiKamarController.getKamar(tipekamarComboBox, noKamarComboBox);
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(this, ex.getMessage());
        }
}//GEN-LAST:event_tipekamarComboBoxActionPerformed

    private void cancelButonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButonActionPerformed
        this.setVisible(false);
        MainController.getFrame().setVisible(true);
        TransaksiKamarController.batalNotaKamar(noCheckinTextField.getText());
}//GEN-LAST:event_cancelButonActionPerformed

    private void checkinbuttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkinbuttonActionPerformed

        int status = TransaksiKamarController.CheckinKamarAction(noCheckinTextField, namaText, alamatText,
                noKamarComboBox, noKTPtext, jenisKTPComboBox,
                tanggalLahirChooser, nomorHPTextField, jumpenyewaText, tanggalLabel,
                tipekamarComboBox, tempatlahirText, wanitaButtonGrup, priaRadioButton1);
        System.out.println(status);
        if (status == 1) {
            batalButt.doClick();
            try {
                TransaksiKamar call;
                call = TransaksiKamar.getKoneksiKontrol();
                noCheckinTextField.setText(TransaksiKamarController.noTrans(call));
            } catch (SQLException ex) {
                Logger.getLogger(CheckInForm.class.getName()).log(Level.SEVERE, null, ex);
            } catch (FileNotFoundException ex) {
                Logger.getLogger(CheckInForm.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                Logger.getLogger(CheckInForm.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }//GEN-LAST:event_checkinbuttonActionPerformed

    private void batalButtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_batalButtActionPerformed
        // TODO add your handling code here:
        namaText.setText("");
        alamatText.setText("");
        noKTPtext.setText("");
        tempatlahirText.setText("");
        tanggalLahirChooser.updateUI();
        jumpenyewaText.setText("");
        nomorHPTextField.setText("");
        tipekamarComboBox.setSelectedIndex(0);
        jenisKTPComboBox.setSelectedIndex(0);
        buttonGroup1.clearSelection();
    }//GEN-LAST:event_batalButtActionPerformed

    private void nomorHPTextFieldKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nomorHPTextFieldKeyReleased
        // TODO add your handling code here:
        if (Character.isLetter((evt.getKeyChar()))) {
            evt.consume();
            JOptionPane.showMessageDialog(null, "Inputkan angka");
            nomorHPTextField.setText("");
        }
    }//GEN-LAST:event_nomorHPTextFieldKeyReleased

    private void jumpenyewaTextKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jumpenyewaTextKeyReleased
        // TODO add your handling code here:
        if (Character.isLetter((evt.getKeyChar()))) {
            evt.consume();
            JOptionPane.showMessageDialog(null, "Inputkan angka");
            jumpenyewaText.setText("");
        }
    }//GEN-LAST:event_jumpenyewaTextKeyReleased
    /**
     * @param args the command line arguments
     */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField alamatText;
    private javax.swing.JButton batalButt;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton cancelButon;
    private javax.swing.JButton checkinbutton;
    private javax.swing.JLabel idKaryawan;
    private javax.swing.JLabel idkaryawanLabel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel jamLabel1;
    private javax.swing.JComboBox jenisKTPComboBox;
    private javax.swing.JTextField jumpenyewaText;
    private javax.swing.JTextField namaText;
    private javax.swing.JTextField noCheckinTextField;
    private javax.swing.JTextField noKTPtext;
    private javax.swing.JComboBox noKamarComboBox;
    private javax.swing.JTextField nomorHPTextField;
    private javax.swing.JRadioButton priaRadioButton1;
    private javax.swing.JLabel tanggalLabel;
    private com.toedter.calendar.JDateChooser tanggalLahirChooser;
    private javax.swing.JTextField tempatlahirText;
    private javax.swing.JComboBox tipekamarComboBox;
    private javax.swing.JRadioButton wanitaButtonGrup;
    // End of variables declaration//GEN-END:variables
}
